package com.rojored.net.imageUploaderClasses 
{

import flash.events.Event;

/**
 *  represents events related to an image upload to the player
 */
public class ImageUploaderEvent extends Event
{

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  the <code>ImageUploaderEvent.IMAGE_UPLOAD_COMPLETE</code> constant
     *  defines the value for the <code>type</code> property of the event that
     *  is dispatched when an image upload to the browser has been completed.
     */
    public static const IMAGE_UPLOAD_COMPLETE:String = "imageUploadComplete";

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor
     */
    public function ImageUploaderEvent(type:String, 
                                       imageFile:ImageFile = null,
                                       bubbles:Boolean = false,
                                       cancelable:Boolean = false)

    {
        super(type, bubbles, cancelable);
        this.imageFile = imageFile;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties 
    //
    //--------------------------------------------------------------------------

    //--------------------------------------
    //  imageFile 
    //--------------------------------------

    /**
     *  the image file uploaded.
     */
    public var imageFile:ImageFile;

    //--------------------------------------------------------------------------
    //
    //  Overridden methods
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    override public function clone():Event 
    {
        return new ImageUploaderEvent(type, imageFile, bubbles, cancelable);
    }

    /**
     *  @private
     */
    override public function toString():String 
    {
        return formatToString(
            "ImageUploaderEvent",
            "type",
            "imageFile",
            "bubbles",
            "cancelable",
            "eventPhase"
        );
    }
}
}
